<template>
  <!-- 检查申请单 -->
  <el-dialog
    v-model="dialogVisible"
    title="检查申请单"
    :width="800"
    :before-close="handleClose"
  >
    <user />
    <div class="mt12">
      <div class="flex a-c mt12 mb12">
        <span>主诉：</span>
        <el-input
          v-model="textarea"
          style="flex: 1"
          :rows="2"
          type="textarea"
          placeholder="输入主诉"
        />
      </div>
      <el-tabs type="border-card">
        <el-tab-pane
          :label="item.label"
          v-for="(item, index) in tabMap"
          :key="index"
        >
          <keep-alive>
            <component :is="item.components"></component>
          </keep-alive>
        </el-tab-pane>
      </el-tabs>
    </div>
  </el-dialog>
</template>
<script setup lang="ts">
import { useDialog } from "@common/src/hooks/dialog.ts";
import mri from "./components/mri.vue";
import cd from "./components/cd.vue";
import ct from "./components/ct.vue";
import dr from "./components/ct.vue";
import cr from "./components/ct.vue";
import user from "./components/user.vue";
const tabMap = [
  {
    label: "CT",
    components: ct,
  },
  {
    label: "DR",
    components: dr,
  },
  {
    label: "彩超",
    components: cd,
  },
  {
    label: "MRI",
    components: mri,
  },
  {
    label: "CR",
    components: cr,
  },
];
const props = withDefaults(
  defineProps<{
    modelValue: boolean;
    params: Object;
  }>(),
  {
    modelValue: false,
    params: () => {},
  }
);

const formInline = reactive({
  user: "",
});

const emit = defineEmits(["update:modelValue"]);
const { handleClose, dialogVisible } = useDialog(props, emit);
</script>

<style lang="scss" scoped>
.cu-p {
  cursor: pointer;
}
</style>
